<template>
  <div class="user-status-container">
    <t-button theme="primary" size="large" variant="base" @click="handleLogOut">
      Log out
    </t-button>
  </div>
</template>

<script lang="ts" setup>
import { useUserStore } from "@/store";
import { useRouter } from "vue-router";

const userStore = useUserStore();
const router = useRouter();

// 退出登录
const handleLogOut = () => {
  userStore.handleSetUserInfo({ account: "", password: "" });
  router.push({ name: "login" });
};
</script>

<style lang="less" scoped>
.user-status-container {
  position: fixed;
  bottom: 28px;
  right: 56px;
  display: flex;
  flex-direction: row;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
